import Mock from 'mockjs'
import { API_MOCK } from '@/config'

Mock.setup({
    timeout: '0-200'
})
const modules = API_MOCK ? import.meta.globEager('./modules/*.js') : []
const mockModules = []
Object.keys(modules).forEach((key) => {
    mockModules.push(...modules[key].default)
})

mockModules.forEach(({ url, method, t }) => {
    Mock.mock(url, method, t)
})
